package com.starview.star.compiler.operator;

import com.starview.star.compiler.standard.StandardNames;
import com.starview.star.compiler.util.PrettyPrintDisplay;
import com.starview.star.compiler.util.PrettyPrintable;

@SuppressWarnings("serial")
public class BracketPair implements PrettyPrintable
{
  public final String leftBracket, rightBracket, operator;
  public final int innerPriority;

  public BracketPair(int innerPriority, String leftBracket, String rightBracket, String operator)
  {
    this.innerPriority = innerPriority;
    this.leftBracket = leftBracket;
    this.rightBracket = rightBracket;
    this.operator = operator;
  }

  @Override
  public String toString()
  {
    return PrettyPrintDisplay.toString(this);
  }

  @Override
  public void prettyPrint(PrettyPrintDisplay disp)
  {
    disp.append(StandardNames.META_HASH);
    disp.appendWord(StandardNames.BRACKETS);
    disp.append("((");
    disp.append(leftBracket);
    disp.append("),(");
    disp.append(rightBracket);
    disp.append("),");
    disp.append(innerPriority);
    disp.append(")");
  }

}
